
;; helper functions for oali.core


(defmacro convert-to-keywords (expr)
  "converts all the symbols in the expression given to theirs equivalents from
the keywords package"
  `(cond
    ((consp ,expr) (loop for sub-expr in ,expr collect
		       (convert-to-keywords sub-expr)))
    ((symbolp ,expr) (intern (princ-to-string ,expr) :keyword))
    (t ,expr)))


(defmacro parse-s (expr-list)
  "version of parse function that converts all symbols in expr-list to their
equivalents from keywords package"
  `(oali.core:parse (oali.core:create-context) (convert-to-keywords ,expr-list)))


#|

(asdf:operate 'asdf:load-op :oali.core)


(setf a (parse-s '((func test (a b c) (returns bool) (progn (return 1))))))

|#



